package com.wh.productMag.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wh.productMag.pojo.ProductList;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* 后端Service接口；
*/
@Mapper
@Repository
public interface ProductListMapper extends BaseMapper<ProductList> {

    /**
     * 分页：查询当前页数据
     * @param page 分页参数
     * @param queryWrapper 查询条件
     * @return
     */
    List<ProductList> findByPage(@Param("page") IPage<ProductList> page,@Param("ew") QueryWrapper<ProductList> queryWrapper);

    void offShelf(Integer id, Integer state);

    void deletebyid(Integer id ,Integer state);

    List<ProductList> findproduct(Long id);

    Long findstockIdByprooductId(Integer productId);

    ProductList findproductByproductid(Long productId);
}
